Vehicle Listener: 

  /*
    @EventHandler
    public void onVehilceEntityCollide(VehicleEntityCollisionEvent event)
    {
    	if(plugin.minecarts && event.getVehicle() instanceof Minecart)
    	{
	    	Entity e = event.getEntity();
	    	if(e instanceof LivingEntity)
	    	{
	    		Vehicle v = event.getVehicle();
	    		LivingEntity le = (LivingEntity) e;
	    		boolean front = isInFrontOf(le,v);
	    		if(front)
	    		{
		    		int dmg = (int) (event.getVehicle().getVelocity().length() * 20);
		    		EntityDamageEvent damage = new EntityDamageEvent(le,DamageCause.ENTITY_ATTACK, dmg);
		    		Bukkit.getPluginManager().callEvent(damage);
		    		if(!damage.isCancelled())
		    		{
			    		if(e instanceof Player)
			    		{
			    			Player p = (Player) e;
			    			if(dmg >= p.getHealth())
			    				plugin.hitPlayers.add(p.getName());
			    		}
			    		if(dmg>2)
			    		{
			    			if(e instanceof Animals && plugin.animalcart)
			    			{
			    				le.damage(dmg);
			    			} else if(e instanceof Monster && plugin.monstercart) {
			    				le.damage(dmg);
			    			} else if(e instanceof Player && plugin.playercart) {
			    				le.damage(dmg);
			    			}
			  
			    		}
		    		}
	    		}
	    	}
    	}
    }
    boolean isInFrontOf(LivingEntity l, Vehicle v) {
    	double dot = v.getVelocity().normalize().dot(l.getLocation().toVector().subtract(v.getLocation().subtract(0,.5,0).toVector()).normalize());
    	return Math.abs(dot) >= Math.cos(Math.PI/4);
    	
    }
    */
    
    
    
    
    
    
    
    Block Listener
    
     /* Depreciated
    public void destroyGhostEntity(Block block, Entity entity)
    {
    	for(Player p : block.getWorld().getPlayers())
    		if(p.getLocation().distance(block.getLocation()) < 50)
    			((org.bukkit.craftbukkit.entity.CraftPlayer)p).getHandle().netServerHandler.sendPacket(new Packet51MapChunk(block.getX(),block.getY(),block.getZ(), 20, 20, 20, (((CraftWorld) block.getWorld()).getHandle())));
    }
    */
    
    /* Sand
	    			net.minecraft.server.World cWorld = ((CraftWorld)w).getHandle();
	  	    	      int id = block.getTypeId();
	    				if(event.getDirection().name().equalsIgnoreCase("up"))
	    				{
	    					EntityFallingBlock sand = new EntityFallingBlock(cWorld,block.getX(),block.getY()+2,block.getZ(),id,block.getData());
	    					CraftFallingSand c = new CraftFallingSand(cWorld.getServer(), sand);
	    					System.out.println("ID: "+id+" Data: "+block.getData());
	    					((WorldServer) cWorld).tracker.track(sand);
	    					System.out.println("Block Y: "+block.getY()+" Sand Y: "+sand.locY);
	    					cWorld.addEntity(sand);
	    					Entity e = sand.getBukkitEntity();
	    					//e.teleport(e.getLocation().add(.5,1.5,.5));
	    					//w.spawnCreature(e.getLocation().add(.5,4.5,.5), EntityType.FALLING_BLOCK);
	  	  	    	      	Vector vel = e.getVelocity();
	  	  	    	      	vel.add(new Vector(0,2,0));
	  	  	    	      	c.setVelocity(vel);
	  	  	    	      	//e.setVelocity(vel);
	  	  	    	      	destroyGhostEntity(block,e,new Vector(0,1,0));
	    				}
	    				
	    				else if(event.getDirection().name().equalsIgnoreCase("north"))
	    				{
	    					block.setTypeId(0);
	    					EntityFallingBlock sand = new EntityFallingBlock(cWorld,block.getX()-.5d,block.getY()+.5d,block.getZ()+.5d,id,0);
	    					Vector vel = sand.getBukkitEntity().getVelocity();
	    					vel.add(new Vector(-1.5,.2,0));
	  	  	    	      	cWorld.addEntity(sand);
	  	  	    	      	sand.getBukkitEntity().setVelocity(vel);
	  	  	    	      	destroyGhostEntity(block,sand.getBukkitEntity(),new Vector(-1,0,0));
	  	  	    	      	
	    				}
	    				else if(event.getDirection().name().equalsIgnoreCase("south"))
	    				{
	    					block.setTypeId(0);
	    					EntityFallingBlock sand = new EntityFallingBlock(cWorld,block.getX()-.5d,block.getY()+.5d,block.getZ()+.5d,id,0);
	    					Vector vel = sand.getBukkitEntity().getVelocity();
	    					vel.add(new Vector(1.5,.2,0));
	  	  	    	      	cWorld.addEntity(sand);
	  	  	    	      	sand.getBukkitEntity().setVelocity(vel);
	  	  	    	      	destroyGhostEntity(block,sand.getBukkitEntity(),new Vector(1,0,0));	
	    				}
	    				else if(event.getDirection().name().equalsIgnoreCase("west"))
	    				{
	    					block.setTypeId(0);
	    					EntityFallingBlock sand = new EntityFallingBlock(cWorld,block.getX()+.5d,block.getY()+.5d,block.getZ()-.5d,id,0);
	    					Vector vel = sand.getBukkitEntity().getVelocity();
	    					vel.add(new Vector(0,.2,1.5));
	    					cWorld.addEntity(sand);    
	  	  	    	      	sand.getBukkitEntity().setVelocity(vel);
	  	  	    	      	destroyGhostEntity(block,sand.getBukkitEntity(),new Vector(0,0,1));	
	    				}
	    				else if(event.getDirection().name().equalsIgnoreCase("east"))
	    				{
	    					block.setTypeId(0);
	    					EntityFallingBlock sand = new EntityFallingBlock(cWorld,block.getX()+.5d,block.getY()+.5d,block.getZ()-.5d,id,0);
	    					Vector vel = sand.getBukkitEntity().getVelocity();
	    					vel.add(new Vector(0,.2,-1.5));
	    					cWorld.addEntity(sand);    
	  	  	    	      	sand.getBukkitEntity().setVelocity(vel);
	  	  	    	      	destroyGhostEntity(block,sand.getBukkitEntity(),new Vector(0,0,-1));	    	
	    				}
	    			}
	    			else
	    			{
	    				break;
	    			}
	    		}	
	    		*/
	    		
	    		/* Depreciated code - Blocks launching entites
		    					if(e.getLocation().distance(event.getBlock().getLocation()) < 2.2)
		    					{
		    						v = e.getVelocity();
		    						Location actualLoc = e.getLocation();
		    						Location truncatedLoc = new Location(w, actualLoc.getBlockX(), actualLoc.getBlockY(), actualLoc.getBlockZ());
		    						Block ent = truncatedLoc.getBlock();
		    						String dir = event.getDirection().name();
		    						if(dir.equalsIgnoreCase("up") && (ent.getRelative(0,-1,0).equals(block)))
		    						{
		    							v.setY(v.getY()+plugin.pistonStrength/2);
		    							e.teleport(e.getLocation().add(0, 1, 0));	
		    						}
				    				else if(dir.equalsIgnoreCase("north") && (ent.getRelative(1,0,0).equals(block) || ent.getRelative(1,1,0).equals(block)))
				              		{
				    					v.setX(v.getX()-plugin.pistonStrength);
										e.teleport(e.getLocation().add(-1, 0, 0));
				              		}
				    				else if(dir.equalsIgnoreCase("south") && (ent.getRelative(-1,0,0).equals(block) || ent.getRelative(-1,1,0).equals(block)))
				              		{
				    					v.setX(v.getX()+plugin.pistonStrength);
										e.teleport(e.getLocation().add(1, 0, 0));
				              		}
				    				else if(dir.equalsIgnoreCase("east") && (ent.getRelative(0,0,1).equals(block) || ent.getRelative(0,1,1).equals(block)))
				              		{
				    					v.setZ(v.getZ()-plugin.pistonStrength);
										e.teleport(e.getLocation().add(0, 0, -1));
				              		}
				    				else if(dir.equalsIgnoreCase("west") && (ent.getRelative(0,0,-1).equals(block) || ent.getRelative(0,1,-1).equals(block)))
				              		{
				    					v.setZ(v.getZ()+plugin.pistonStrength);
										e.teleport(e.getLocation().add(0, 0, 1));
				              		}
		    					}
		    					*/
		    					
		    					 /* Depreciated code - Pistons pushing entities, no block between.
				if(e.getLocation().distance(event.getBlock().getLocation()) < 2.2)
				{
					String dir = event.getDirection().name();
					if(dir.equalsIgnoreCase("up") && (block.getRelative(0,-1,0).equals(piston)))
					{
						v.setY(v.getY()+plugin.pistonStrength/2);
						e.teleport(e.getLocation().add(0, 1, 0));	
					}
					else if(dir.equalsIgnoreCase("north") && (block.getRelative(1,0,0).equals(piston) || block.getRelative(1,1,0).equals(piston)))
					{
						v.setX(v.getX()-plugin.pistonStrength);
						e.teleport(e.getLocation().add(-1, 0, 0));
					}
					else if(dir.equalsIgnoreCase("south") && (block.getRelative(-1,0,0).equals(piston) || block.getRelative(-1,1,0).equals(piston)))
					{
						v.setX(v.getX()+plugin.pistonStrength);
						e.teleport(e.getLocation().add(1, 0, 0));
					}
					else if(dir.equalsIgnoreCase("west") && (block.getRelative(0,0,-1).equals(piston) || block.getRelative(0,1,-1).equals(piston)))
					{
						v.setZ(v.getZ()+plugin.pistonStrength);
						e.teleport(e.getLocation().add(0, 0, 1));
					}
					else if(dir.equalsIgnoreCase("east") && (block.getRelative(0,0,1).equals(piston) || block.getRelative(0,1,1).equals(piston)))
					{
						v.setZ(v.getZ()-plugin.pistonStrength);
						e.teleport(e.getLocation().add(0, 0, -1));
					}
					
				}
				if(v != null && e != null && v != e.getVelocity())
				{
					e.setVelocity(v);
				}
				v=null;
				*/
		    					